Repository navigation
Document quality report POI options - #178
Merged
Merged
Conversation
The quality report POST takes an optional JSON body choosing which kinds of points of interest to include (poi_types) and the state Overture places must be in (poi_state, default WA). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The quality report request body can now be multipart/form-data with a `pois_file` CSV, used as-is in place of fetching points of interest from OpenStreetMap and Overture Maps. The spec gives the required columns, says it cannot be combined with `poi_types` / `poi_state`, and adds both cases to the 400 response. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report pipeline now works out the state itself, by intersecting the dataset's area with US state boundaries, so callers no longer choose one: Overture places are fetched only in the US state(s) the dataset's area overlaps; for an area outside every state, they are fetched without a state filter. Removes the poi_state property and its enum from the JSON request body, and updates the request body, pois_file and 400 descriptions to match. poi_types and pois_file are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
susrisha
approved these changes
Nov 20, 2026
jeffmaki
added a commit
to TaskarCenterAtUW/TDEI-osw-datasvc-ts
that referenced
this pull request
Nov 20, 2026
## Summary
`POST /api/v1/osw/quality-report/{tdei_dataset_id}` now takes an
optional JSON body:
```json
{ "poi_types": ["civic", "leisure"] }
```
**`poi_types`** chooses which kinds of points of interest the report
looks for. Leaving it out means every type.
There's no state option. The report fetches Overture places only in the
US states the dataset's area overlaps, and with no state filter when the
area overlaps none (TDEI-quality-reports#182). An earlier version of
this PR had `poi_state`. A body that still sends it is accepted, and the
field is ignored.
Where each part lives:
- `QualityReportRequest` (`src/model/request-interfaces.ts`) checks the
body. A non-array, an empty array, or a name that isn't lowercase
returns a 400. Type names are checked only for their form; the report
pipeline owns the list and rejects names it doesn't know, so adding a
type doesn't need a release here.
- The job saves the option in `request_input`, so it appears on the job.
- The `osw_quality_report` workflow (`tdei-orchestrator-config_v2.json`)
passes `poi_types` to the report as text. **It is always sent, empty
when not chosen.** The lodash template throws on a missing key, and
`validateInput` requires every declared key; the report reads an empty
value as its default. Lists are sent comma-joined because `map_props`
JSON-parses every value it renders.
A request with no body behaves exactly as it does today.
## Uploading a pois.csv
The endpoint also takes `multipart/form-data` with a `pois_file`. This
is the job's own `pois.csv`, which the report uses as-is instead of
fetching POIs, for that job only.
- **Checks:**
- `qualityReportUpload` accepts `.csv` only.
- `QualityReportRequest.validatePoisFile` checks the header for `lat`,
`lon`, `category`, `source` and `snapped`, the columns the report
requires of a cached `pois.csv`. The report checks every row.
- Sending `poi_types` with a file is a 400, because it chooses what to
fetch.
- **Storage:** the service stores the file under
`jobs/quality-report/…/pois.csv` before creating the job, so a failed
upload leaves no stuck job.
- **Link to the report:** the report runs under a different storage
account, so the workflow carries a 72-hour read-only SAS link as
`pois_file_url`. Like the options, it is always sent, and empty without
a file.
- **What the job shows:** the job's `request_input` records only
`pois_file: <name>`, because the link grants read access and jobs are
visible to users.
**Deploy this after the pipeline and its function app**
(TDEI-quality-reports#181). Until they know `pois_file_url`, an uploaded
file is dropped and the report fetches POIs instead, with no error.
## Related
This is part of a four-repo change, documented end to end in the
pipeline's `CLAUDE.md`:
- Pipeline:
- TaskarCenterAtUW/TDEI-quality-reports#176 (POI
options, merged)
- TaskarCenterAtUW/TDEI-quality-reports#181
(`pois_file`)
- TaskarCenterAtUW/TDEI-quality-reports#182 (the
states come from the dataset's area)
- API spec:
TaskarCenterAtUW/TDEI-ExternalAPIs#178
- Create Job form:
TaskarCenterAtUW/TDEI-user-management-front-end#357
## Testing
- `npm test`: 516 unit tests pass.
- New tests:
- controller: the options are passed through, 3 bad bodies each return a
400, and a leftover `poi_state` is dropped;
- service: an empty-options test, and a test that options reach both
`request_input` and `workflow_input`;
- workflow config: the real `osw_quality_report` template renders
`poi_types`, set and unset, and has no `poi_state`;
- controller, `pois_file`: three good files reach the service (a plain
header; a byte order mark with quoted names and CRLF; a header only).
Three bad uploads each return a 400 and create no job: one with
`poi_types`, one with no `snapped` column, and an empty file;
- service, `pois_file`: the file is stored, the job records only its
name, and the workflow gets the SAS link. No job is created when storing
the file fails;
- workflow config, `pois_file`: a SAS link, with its `&`, `=` and `%`,
renders unchanged, and an empty one renders empty.
- `tsc` passes. Lint shows nothing new on the changed lines.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the new optional JSON request body for
POST /api/v1/osw/quality-report/{tdei_dataset_id}. It is added totdei-api-gateway.json,-stage.jsonand-prod.json, with identical changes in each:poi_types: an array of POI type names. The enum lists the 11 types, each with a description. Leaving it out includes every type.There's no state option. The request description says the report fetches Overture places only in the US states the dataset's area overlaps, and with no state filter when the area overlaps none. An earlier version of this PR documented
poi_state; it was removed when the pipeline started working the state out itself (TDEI-quality-reports#182).It also documents a
multipart/form-databody with one field,pois_file. This is the job's ownpois.csv, used as-is instead of fetching POIs, for that job only. Its description gives the required columns (lat,lon,category,source,snapped, withsnappedtrue on every row) and says it can't be sent withpoi_types.The 400 response now also covers invalid options, a
pois_filewithout the required columns, and apois_filesent with options.Related
This is part of a four-repo change:
pois_file)The UI keeps its own copy of this spec,
tdei-ui/src/assets/api_spec.json. That PR makes the same change there, and the quality-report operation is identical in both.Testing
All three files still parse as JSON, and none of their other content changed.
@redocly/cli lintreports the same findings before and after thepois_filechange (1 error, 13 warnings, all already there).🤖 Generated with Claude Code